# coding=utf-8

# c = 1
# print(id(c))
#
# d = 1
# print(id(d))
#
# e = "will"
# print(id(e))
#
# f = "will"
# print(id(f))
#
# g = [1,2,3]
# print(id(g[0]))


aa = "a=1&b=2&c=3&aa"

values = aa.split("&")

# print(values)

# aa_dict = {}
#
# for value in values:
#     # print(value)
#     value_a = value.split('=')
#     # print(value_a)
#     if len(value_a) > 1:
#         aa_dict[value_a[0]] = value_a[1]
#     else:
#         aa_dict[value_a[0]] = None
#
# print(aa_dict)
#
# aa_list = []
#
# for key,value in aa_dict.items():
#     if not aa_dict[key] is None:
#         aa_list.append("=".join([key,value]))
#     else:
#         aa_list.append(key)
# print(aa_list)
#
# res = "&".join(aa_list)
# print(res)



height = [5,4,3,2,1]



# 对剩下的元素，重复第一步比较，轮次也是比元素少一次
for j in range(len(height)-1):

    # 第一个为标准
    base = 0
    # 每一轮选出最大，最小的放到末尾
    # 因为第一个是标准，所以下标从1开始
    # 每一轮比较，都要少比较一个元素，所以-j
    for i in range(1, len(height) - j):
        if height[i] > height[base]:
            base = i

    # 放到末尾（每一轮的末尾都多一个元素）
    height[base], height[len(height) - 1 - j] = height[len(height) - 1 - j], height[base]

    print(height)















